{smcl}
{com}{sf}{ul off}{txt}{.-}
      name:  {res}<unnamed>
       {txt}log:  {res}C:\Users\MB\Desktop\JOP_Replicate\ReplicationUpload\LogforFigure1.smcl
  {txt}log type:  {res}smcl
 {txt}opened on:  {res} 9 Feb 2023, 19:14:51

{com}. do "C:\Users\MB\Desktop\JOP_Replicate\ReplicationUpload\PaperFigure1.do"
{txt}
{com}. cap which clarify.hlp
{txt}
{com}. if _rc ssc install clarify
{txt}checking {hilite:clarify} consistency and verifying not already installed...
all files already exist and are up to date.

{com}. 
.         
. capture program drop nnsim
{txt}
{com}. program define nnsim, rclass
{txt}  1{com}.         version 16.1
{txt}  2{com}.         syntax [, yy(integer 1946)]
{txt}  3{com}.                 tempvar temp0 temp1 temp2 temp3
{txt}  4{com}.         gen `temp0' = rbinomial(1, proatt0) if year_a ==`yy'
{txt}  5{com}.         summarize `temp0'
{txt}  6{com}.         return scalar att0 = r(sum)
{txt}  7{com}.         gen `temp1' = rbinomial(1, proatt1) if year_a ==`yy'
{txt}  8{com}.         summarize `temp1'
{txt}  9{com}.         return scalar att1 = r(sum)
{txt} 10{com}.         gen `temp2' = rbinomial(1, protol0) if year_a ==`yy'
{txt} 11{com}.         summarize `temp2'
{txt} 12{com}.         return scalar tol0 = r(sum)
{txt} 13{com}.         gen `temp3' = rbinomial(1, protol1) if year_a ==`yy'
{txt} 14{com}.         summarize `temp3'
{txt} 15{com}.         return scalar tol1 = r(sum)
{txt} 16{com}.     end
{txt}
{com}. 
. 
. 
. * load the replication data set, but do not save over it        
. 
. 
. xtset audience year, yearly
{res}
{col 1}{txt:Panel variable: }{res:audience}{txt: (unbalanced)}
{p 1 16 2}{txt:Time variable: }{res:year_a}{txt:, }{res:{bind:1939}}{txt: to }{res:{bind:2018}}{txt:, but with gaps}{p_end}
{txt}{col 10}Delta: {res}1 year
{txt}
{com}. 
.         
.         
. capture drop b1-b4
{txt}
{com}. 
. logit audience_accel  Nat_total_full_5 tol_end_total_full_5 dll_total_full_5  if aec2==1 & year_a>1945 & (audience_pursue ==0 | pursue_start==1), vce(cluster audience)

{res}{txt}Iteration 0:{space 3}log pseudolikelihood = {res:-257.69965}  
Iteration 1:{space 3}log pseudolikelihood = {res: -245.2775}  
Iteration 2:{space 3}log pseudolikelihood = {res:-240.80828}  
Iteration 3:{space 3}log pseudolikelihood = {res:-240.74026}  
Iteration 4:{space 3}log pseudolikelihood = {res: -240.7402}  
Iteration 5:{space 3}log pseudolikelihood = {res: -240.7402}  
{res}
{txt}{col 1}Logistic regression{col 57}{lalign 13:Number of obs}{col 70} = {res}{ralign 6:5,681}
{txt}{col 57}{lalign 13:Wald chi2({res:3})}{col 70} = {res}{ralign 6:35.21}
{txt}{col 57}{lalign 13:Prob > chi2}{col 70} = {res}{ralign 6:0.0000}
{txt}{col 1}{lalign 20:Log pseudolikelihood}{col 21} = {res}{ralign 9:-240.7402}{txt}{col 57}{lalign 13:Pseudo R2}{col 70} = {res}{ralign 6:0.0658}

{txt}{ralign 86:(Std. err. adjusted for {res:141} clusters in {res:audience})}
{hline 21}{c TT}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
{col 22}{c |}{col 34}    Robust
{col 1}      audience_accel{col 22}{c |} Coefficient{col 34}  std. err.{col 46}      z{col 54}   P>|z|{col 62}     [95% con{col 75}f. interval]
{hline 21}{c +}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
{space 4}Nat_total_full_5 {c |}{col 22}{res}{space 2}-.6727956{col 34}{space 2} .2299817{col 45}{space 1}   -2.93{col 54}{space 3}0.003{col 62}{space 4}-1.123551{col 75}{space 3}-.2220398
{txt}tol_end_total_full_5 {c |}{col 22}{res}{space 2} .6987064{col 34}{space 2} .2220066{col 45}{space 1}    3.15{col 54}{space 3}0.002{col 62}{space 4} .2635815{col 75}{space 3} 1.133831
{txt}{space 4}dll_total_full_5 {c |}{col 22}{res}{space 2} -.113742{col 34}{space 2} .2092963{col 45}{space 1}   -0.54{col 54}{space 3}0.587{col 62}{space 4}-.5239552{col 75}{space 3} .2964713
{txt}{space 15}_cons {c |}{col 22}{res}{space 2}-4.924702{col 34}{space 2} .3589409{col 45}{space 1}  -13.72{col 54}{space 3}0.000{col 62}{space 4}-5.628213{col 75}{space 3} -4.22119
{txt}{hline 21}{c BT}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}

{com}. 
. 
. keep if e(sample)
{txt}(5,151 observations deleted)

{com}. 
. capture drop proatt*
{txt}
{com}. qui gen proatt0=.
{txt}
{com}. qui gen proatt1=.
{txt}
{com}. 
. estsimp logit audience_accel  Nat_total_full_5 tol_end_total_full_5 dll_total_full_5  if aec2==1 & year_a>1945 & (audience_pursue ==0 | pursue_start==1), vce(cluster audience)

{txt}Iteration 0:   log pseudolikelihood = {res}-257.69965
{txt}Iteration 1:   log pseudolikelihood = {res} -245.2775
{txt}Iteration 2:   log pseudolikelihood = {res}-240.99154
{txt}Iteration 3:   log pseudolikelihood = {res}-240.74332
{txt}Iteration 4:   log pseudolikelihood = {res}-240.74021
{txt}Iteration 5:   log pseudolikelihood = {res} -240.7402

{txt}Logistic regression                               Number of obs   = {res}      5681
                                                  {txt}Wald chi2({res}3{txt})    = {res}     35.21
                                                  {txt}Prob > chi2     = {res}    0.0000
{txt}Log pseudolikelihood = {res} -240.7402                 {txt}Pseudo R2       = {res}    0.0658

                             {txt}(Std. err. adjusted for {res}141{txt} clusters in audience)
{hline 13}{c TT}{hline 64}
             {c |}               Robust
audience_a~l {c |} Coefficient  std. err.      z    P>|z|     [95% conf. interval]
{hline 13}{c +}{hline 64}
Nat_total_~5 {c |}  {res}-.6727956   .2299816    -2.93   0.003    -1.123551   -.2220399
{txt}tol_end_to~5 {c |}  {res} .6987064   .2220066     3.15   0.002     .2635815    1.133831
{txt}dll_total_~5 {c |}  {res} -.113742   .2092963    -0.54   0.587    -.5239552    .2964712
       {txt}_cons {c |}  {res}-4.924702   .3589408   -13.72   0.000    -5.628213    -4.22119
{txt}{hline 13}{c BT}{hline 64}

{res}Simulating main parameters.  Please wait....
% of simulations completed: 25% 50% 75% 100% 

Number of simulations  : 1000
Names of new variables : b1 b2 b3 b4
{txt}
{com}. 
. forval oo = 1/5681 {c -(}
{txt}  2{com}. capture drop temp0 temp1
{txt}  3{com}. setx [`oo'] 
{txt}  4{com}. *setx at_total_full_5 0 tol_end_total_full_5 0 dll_total_full_5 0 
. qui simqi, genpr(temp0 temp1)
{txt}  5{com}. qui sum temp1
{txt}  6{com}. qui replace proatt0 = r(mean) in `oo'
{txt}  7{com}. 
. 
. capture drop temp0 temp1
{txt}  8{com}. setx [`oo'] 
{txt}  9{com}. setx Nat_total_full_5 Nat_total_full_5[`oo']+1 
{txt} 10{com}. qui simqi, genpr(temp0 temp1)
{txt} 11{com}. qui sum temp1
{txt} 12{com}. qui replace proatt1 = r(mean) in `oo'
{txt} 13{com}. 
. {c )-}
{txt}
{com}. 
. 
. 
. capture drop b1-b4
{txt}
{com}. 
. capture drop protol*
{txt}
{com}. 
. qui gen protol0=.
{txt}
{com}. qui gen protol1=.
{txt}
{com}. 
. estsimp logit audience_accel  Nat_total_full_5 tol_end_total_full_5 dll_total_full_5  if aec2==1 & year_a>1945 & (audience_pursue ==0 | pursue_start==1), vce(cluster audience)

{txt}Iteration 0:   log pseudolikelihood = {res}-257.69965
{txt}Iteration 1:   log pseudolikelihood = {res} -245.2775
{txt}Iteration 2:   log pseudolikelihood = {res}-240.99154
{txt}Iteration 3:   log pseudolikelihood = {res}-240.74332
{txt}Iteration 4:   log pseudolikelihood = {res}-240.74021
{txt}Iteration 5:   log pseudolikelihood = {res} -240.7402

{txt}Logistic regression                               Number of obs   = {res}      5681
                                                  {txt}Wald chi2({res}3{txt})    = {res}     35.21
                                                  {txt}Prob > chi2     = {res}    0.0000
{txt}Log pseudolikelihood = {res} -240.7402                 {txt}Pseudo R2       = {res}    0.0658

                             {txt}(Std. err. adjusted for {res}141{txt} clusters in audience)
{hline 13}{c TT}{hline 64}
             {c |}               Robust
audience_a~l {c |} Coefficient  std. err.      z    P>|z|     [95% conf. interval]
{hline 13}{c +}{hline 64}
Nat_total_~5 {c |}  {res}-.6727956   .2299816    -2.93   0.003    -1.123551   -.2220399
{txt}tol_end_to~5 {c |}  {res} .6987064   .2220066     3.15   0.002     .2635815    1.133831
{txt}dll_total_~5 {c |}  {res} -.113742   .2092963    -0.54   0.587    -.5239552    .2964712
       {txt}_cons {c |}  {res}-4.924702   .3589408   -13.72   0.000    -5.628213    -4.22119
{txt}{hline 13}{c BT}{hline 64}

{res}Simulating main parameters.  Please wait....
% of simulations completed: 25% 50% 75% 100% 

Number of simulations  : 1000
Names of new variables : b1 b2 b3 b4
{txt}
{com}. 
. forval oo = 1/5681 {c -(}
{txt}  2{com}. capture drop temp0 temp1
{txt}  3{com}. setx [`oo'] 
{txt}  4{com}. qui simqi, genpr(temp0 temp1)
{txt}  5{com}. qui sum temp1
{txt}  6{com}. qui replace protol0 = r(mean) in `oo'
{txt}  7{com}. 
. 
. capture drop temp0 temp1
{txt}  8{com}. setx [`oo'] 
{txt}  9{com}. setx tol_end_total_full_5 tol_end_total_full_5[`oo']+1 
{txt} 10{com}. qui simqi, genpr(temp0 temp1)
{txt} 11{com}. qui sum temp1
{txt} 12{com}. qui replace protol1 = r(mean) in `oo'
{txt} 13{com}. 
. {c )-}
{txt}
{com}. 
. 
. qui gen proattdif = proatt1-proatt0
{txt}
{com}. qui gen proattperc = (proatt1-proatt0)/proatt0
{txt}
{com}. qui gen protoldif = protol1-protol0
{txt}
{com}. qui gen protolperc = (protol1-protol0)/protol0
{txt}
{com}. 
. 
. 
. capture drop Natt* Ntol*
{txt}
{com}. 
. qui gen Natt0=.
{txt}
{com}. qui gen Natt1=.
{txt}
{com}. qui gen Ntol0=.
{txt}
{com}. qui gen Ntol1=.
{txt}
{com}. 
. qui gen Natt0m=.
{txt}
{com}. qui gen Natt1m=.
{txt}
{com}. qui gen Ntol0m=.
{txt}
{com}. qui gen Ntol1m=.
{txt}
{com}. 
. 
. forval yyy = 1946/2018 {c -(}
{txt}  2{com}. di `yyy'
{txt}  3{com}. capture drop simtemtol0 simtemtol1 simtematt0 simtematt1 
{txt}  4{com}. qui gen simtemtol0=.
{txt}  5{com}. qui gen simtemtol1=.
{txt}  6{com}. qui gen simtematt0=.
{txt}  7{com}. qui gen simtematt1=.
{txt}  8{com}. forval it = 1/1000 {c -(}
{txt}  9{com}. qui nnsim, yy(`yyy')    
{txt} 10{com}. qui replace simtemtol0 = r(tol0) in `it'
{txt} 11{com}. qui replace simtemtol1 = r(tol1) in `it'
{txt} 12{com}. qui replace simtematt0 = r(att0) in `it'
{txt} 13{com}. qui replace simtematt1 = r(att1) in `it'
{txt} 14{com}. {c )-}
{txt} 15{com}. qui sum simtemtol0
{txt} 16{com}. qui replace Ntol0= r(mean) if year_a == `yyy'
{txt} 17{com}. qui sum simtemtol1
{txt} 18{com}. qui replace Ntol1= r(mean) if year_a == `yyy'
{txt} 19{com}. qui sum simtematt0
{txt} 20{com}. qui replace Natt0= r(mean) if year_a == `yyy'
{txt} 21{com}. qui sum simtematt1
{txt} 22{com}. qui replace Natt1= r(mean) if year_a == `yyy'
{txt} 23{com}. 
. qui centile simtemtol0
{txt} 24{com}. qui replace Ntol0m= r(c_1) if year_a == `yyy'
{txt} 25{com}. qui centile simtemtol1
{txt} 26{com}. qui replace Ntol1m= r(c_1) if year_a == `yyy'
{txt} 27{com}. qui centile simtematt0
{txt} 28{com}. qui replace Natt0m= r(c_1) if year_a == `yyy'
{txt} 29{com}. qui centile simtematt1
{txt} 30{com}. qui replace Natt1m= r(c_1) if year_a == `yyy'
{txt} 31{com}. 
. {c )-}
1946
1947
1948
1949
1950
1951
1952
1953
1954
1955
1956
1957
1958
1959
1960
1961
1962
1963
1964
1965
1966
1967
1968
1969
1970
1971
1972
1973
1974
1975
1976
1977
1978
1979
1980
1981
1982
1983
1984
1985
1986
1987
1988
1989
1990
1991
1992
1993
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
{txt}
{com}. 
. 
. 
. keep audience year_a audience_on audience_explore audience_pursue audience_start audience_end  Nat_total_full_5 tol_end_total_full_5 dll_total_full_5 aec2 proatt0-Ntol1m
{txt}
{com}. 
. 
. duplicates drop year_a, force

{p 0 4}{txt}Duplicates in terms of {res} year_a{p_end}

{txt}(5,608 observations deleted)

{com}. 
. tsset year_a
{res}
{p 0 15 2}{txt:Time variable: }{res:year_a}{txt:, }{res:{bind:1946}}{txt: to }{res:{bind:2018}}{p_end}
{txt}{col 9}Delta: {res}1 year
{txt}
{com}. tssmooth ma Natt05= Natt0 , window(5 1)
{txt}The smoother applied was
{res}{p 5 5 5}(1/6)*[x(t-5) + x(t-4) + x(t-3) + x(t-2) + x(t-1) + 1*x(t)]; x(t)= Natt0 {p_end}
{txt}
{com}. replace Natt05 = Natt05*6
{txt}(73 real changes made)

{com}. 
. tssmooth ma Natt15= Natt1 , window(5 1)
{txt}The smoother applied was
{res}{p 5 5 5}(1/6)*[x(t-5) + x(t-4) + x(t-3) + x(t-2) + x(t-1) + 1*x(t)]; x(t)= Natt1 {p_end}
{txt}
{com}. replace Natt15 = Natt15*6
{txt}(73 real changes made)

{com}. 
. 
. tssmooth ma Ntol05= Ntol0 , window(5 1)
{txt}The smoother applied was
{res}{p 5 5 5}(1/6)*[x(t-5) + x(t-4) + x(t-3) + x(t-2) + x(t-1) + 1*x(t)]; x(t)= Ntol0 {p_end}
{txt}
{com}. replace Ntol05 = Ntol05*6
{txt}(73 real changes made)

{com}. 
. tssmooth ma Ntol15= Ntol1 , window(5 1)
{txt}The smoother applied was
{res}{p 5 5 5}(1/6)*[x(t-5) + x(t-4) + x(t-3) + x(t-2) + x(t-1) + 1*x(t)]; x(t)= Ntol1 {p_end}
{txt}
{com}. replace Ntol15 = Ntol15*6
{txt}(73 real changes made)

{com}. 
. *save "Figure1Output.dta", replace
. 
. twoway (line Ntol05 year_a)(line Ntol15 year_a), legend(label(1 "Observed Expectation") label(2 "With an Extra Toleration")) xtitle("Year") ytitle("Expected no of States with Increased Activity")
{res}{txt}
{com}. 
. *graph save "Graph" "Figure1a.gph"
. 
. twoway (line Natt05 year_a)(line Natt15 year_a), legend(label(1 "Observed Expectation") label(2 "With an Extra Attack")) xtitle("Year") ytitle("Expected no of States with Increased Activity")
{res}{txt}
{com}. 
. *graph save "Graph" "Figure1b.gph"
. 
{txt}end of do-file

{com}. log close
      {txt}name:  {res}<unnamed>
       {txt}log:  {res}C:\Users\MB\Desktop\JOP_Replicate\ReplicationUpload\LogforFigure1.smcl
  {txt}log type:  {res}smcl
 {txt}closed on:  {res} 9 Feb 2023, 19:16:55
{txt}{.-}
{smcl}
{txt}{sf}{ul off}